package com.tianlu.store.common;

/**
 * @author liangdl
 * @since 2023/4/1 18:00
 */
public class ServiceException extends RuntimeException {
    private static final long serialVersionUID = 1L;
    private ResultCode resultCode;
    private String appendErrorMessage;
    private String appendUserMessage;

    public ServiceException() {
    }

    public ServiceException(ResultCode resultCode) {
        this.resultCode = resultCode;
    }

    public ServiceException(ResultCode resultCode, String message) {
        this.resultCode = resultCode;
        this.appendErrorMessage = message;
        this.appendUserMessage = message;
    }

    public ServiceException(ResultCode resultCode, String appendErrorMessage, String appendUserMessage) {
        this.resultCode = resultCode;
        this.appendErrorMessage = appendErrorMessage;
        this.appendUserMessage = appendUserMessage;
    }

    public ServiceException(Throwable cause) {
        super(cause);
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
    }

    public ResultCode getResultCode() {
        return this.resultCode;
    }

    public void setResultCode(ResultCode resultCode) {
        this.resultCode = resultCode;
    }

    public String getAppendErrorMessage() {
        return this.appendErrorMessage;
    }

    public void setAppendErrorMessage(String appendErrorMessage) {
        this.appendErrorMessage = appendErrorMessage;
    }

    public String getAppendUserMessage() {
        return this.appendUserMessage;
    }

    public void setAppendUserMessage(String appendUserMessage) {
        this.appendUserMessage = appendUserMessage;
    }
}
